package com.icez.designmode

import androidx.appcompat.app.AppCompatActivity
import android.os.Bundle
import android.util.Log
import com.icez.banner_view.BannerView
import com.icez.designmode.databinding.ItemBannerBinding

class MainActivity : AppCompatActivity() {
    var bannerAdapter:BannerAdapter ?= null
    var bannerView:BannerView ?= null
    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        setContentView(R.layout.activity_main)
        bannerView = findViewById(R.id.bannerView)
        val list = ArrayList<String>()
        for(i in 0 until 10){
            list.add("数据$i")
        }
        bannerAdapter = BannerAdapter(R.layout.item_banner,list)
        bannerView?.setAdapter(bannerAdapter,object:BannerView.OnPageListener{
            override fun onPaged(position: Int) {
                Log.e("icez","索引: $position")
            }

        })
    }
}